using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
    [Table("bgm_project_control"), DataContract]
    public class ProjectControl
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "BgmProjCtrlId", ResourceType = typeof(Resources.ProjectControlResource))]
        [Column("bgm_proj_ctrl_seq", TypeName="int")]
        public int BgmProjCtrlId { get; set; }

        [DataMember, Display(Name = "BgmYear", ResourceType = typeof(Resources.ProjectControlResource))]
        [Column("bgm_year", TypeName="int")]
        public Nullable<int> BgYear { get; set; }

        [ForeignKey("MasBudgetSource")]
        [DataMember, Display(Name = "BgSourceId", ResourceType = typeof(Resources.ProjectControlResource))]
        [Column("bgm_source_seq", TypeName="int")]
        public Nullable<int> BgSourceId { get; set; }

        [ForeignKey("BgmStratList")]
        [DataMember, Display(Name = "BgmStratListId", ResourceType = typeof(Resources.ProjectControlResource))]
        [Column("bgm_strat_list_seq", TypeName="int")]
        public Nullable<int> BgmStratListId { get; set; }

        [ForeignKey("JobSite")]
        [DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.ProjectControlResource))]
        [Column("job_site_seq", TypeName="int")]
        public Nullable<int> JobSiteId { get; set; }

        [ForeignKey("MasBudgetExpenseGroup")]
        [DataMember, Display(Name = "BgExpGrpId", ResourceType = typeof(Resources.ProjectControlResource))]
        [Column("bgm_exp_grp_seq", TypeName="int")]
        public Nullable<int> BgExpGrpId { get; set; }

        [DataMember]
        public virtual MasBudgetSource MasBudgetSource { get; set; }

        [DataMember]
        public virtual StrategyDataList BgmStratList { get; set; }

        [DataMember]
        public virtual HRM.JobSite JobSite { get; set; }

        [DataMember]
        public virtual MasBudgetExpenseGroup MasBudgetExpenseGroup { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}